home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / unix / volume17 / mgr / part21 < prev    next >
Encoding:
Internet Message Format  |  1989-01-19  |  51.9 KB

  1. Subject:  v17i022:  MGR, Bellcore window manager, Part21/61
  2. Newsgroups: comp.sources.unix
  3. Approved: rsalz@uunet.UU.NET
  4.  
  5. Submitted-by: Stephen A. Uhler <sau@bellcore.com>
  6. Posting-number: Volume 17, Issue 22
  7. Archive-name: mgr/part21
  8.  
  9.  
  10.  
  11.  
  12. #! /bin/sh
  13. # This is a shell archive.  Remove anything before this line, then unpack
  14. # it by saving it into a file and typing "sh file".  To overwrite existing
  15. # files, type "sh file -c".  You can also feed this as standard input via
  16. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  17. # will see the following message at the end:
  18. #        "End of archive 21 (of 61)."
  19. # Contents:  Makefile demo/misc/clock.c doc/zoom.1 font-32/Ugal12x20b
  20. #   font-32/Ugal12x20r src/fast_scroll.c src/get_text.c src/getshell.c
  21. #   src/oblit/line.c
  22. # Wrapped by rsalz@papaya.bbn.com on Thu Nov 17 21:05:24 1988
  23. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  24. if test -f 'Makefile' -a "${1}" != "-c" ; then 
  25.   echo shar: Will not clobber existing file \"'Makefile'\"
  26. else
  27. echo shar: Extracting \"'Makefile'\" \(5287 characters\)
  28. sed "s/^X//" >'Makefile' <<'END_OF_FILE'
  29. X#                        Copyright (c) 1987 Bellcore
  30. X#                            All Rights Reserved
  31. X#       Permission is granted to copy or use this program, EXCEPT that it
  32. X#       may not be sold for profit, the copyright notice must be reproduced
  33. X#       on copies, and credit should be given to Bellcore where it is due.
  34. X#       BELLCORE MAKES NO WARRANTY AND ACCEPTS NO LIABILITY FOR THIS PROGRAM.
  35. X
  36. X#    $Header: Makefile,v 4.10 88/08/25 17:15:04 bianchi Exp $
  37. X#    $Source: /tmp/mgrsrc/RCS/Makefile,v $
  38. X
  39. X#    top level makefile for mgr
  40. X
  41. X#########################################################################
  42. X
  43. X#    To make mgr type:
  44. X#    make INSROOT=<root> TARGET=<target> [OTHERLIB=<otherlib>]
  45. X#        <root> is the mgr root directory (normally /usr/mgr)
  46. X#        <target> is the target version of mgr, typically
  47. X#            prod:     for the "production" monochrome release or
  48. X#            color: for the color version
  49. X#        <otherlib> is the name of any auxiliary graphics libraries required.
  50. X#            The color (and 386/i) versions need -lpixrect
  51. X#
  52. X
  53. X#########################################################################33
  54. X
  55. X
  56. X# set to root of mgr directory
  57. XINSROOT = /usr/mgr
  58. XINSROOT = /usr/public/pkg/nmgr
  59. X
  60. X# set to auxiliary bitmap library (use -lpixrect for color)
  61. XOTHERLIB=-lpixrect
  62. XOTHERLIB=
  63. X
  64. X# pieces necessary for creating demos and applications only
  65. X# (for not-necessarily-suns)
  66. XSMALLDIR = lib demo doc menu
  67. X
  68. X# directories that need making (-src, a special case)
  69. XSUBDIR = font icon $(SMALLDIR)
  70. X
  71. X# full mgr directories
  72. XALLDIR = src font-16 font-32 icon $(SMALLDIR) misc
  73. X
  74. XSTART=.
  75. X
  76. XCPIO=cpio
  77. XCPIO_OUT=mgr.cpio
  78. XCPIO_OPTS = ocv
  79. X
  80. XMAKE=make
  81. XTARGET=all
  82. X
  83. Xall:    src $(SUBDIR)
  84. X
  85. X#    this is broken - use co_mgr instead
  86. Xco:
  87. X    -mkdir $(ALLDIR)
  88. X    co `make -s list MAKE=true`
  89. X    for i in $(ALLDIR); do \
  90. X    (cd $$i; echo "    co: $$i";\
  91. X     co Makefile
  92. X     $(MAKE) co ;\
  93. X     cd ..);\
  94. X    done    
  95. X
  96. X#    "make fast" builds the mgr command quickly, without paying attention
  97. X#    to dependencies.
  98. X
  99. Xfast:
  100. X    cd src;  echo "    making src fast";  $(MAKE)  INSROOT=$(INSROOT) fast
  101. X
  102. X
  103. X#    "make small" builds the mgr support library and support commands.
  104. X#    A "small" mgr package (see smallinstall and smallcpio) is that portion
  105. X#    which does not necessarily have to be on the same machine as the mgr
  106. X#    command.
  107. X
  108. Xsmall:
  109. X    for i in $(SMALLDIR); do \
  110. X    (cd $$i; echo "    making $$i";\
  111. X      $(MAKE)  INSROOT=$(INSROOT) $@;\
  112. X     cd ..);\
  113. X    done    
  114. X
  115. X#    "make <<directoryname>>" will make the named directory.  Note that this
  116. X#    is the better way to make individual subdirectories because that way
  117. X#    INSROOT is propigated down to all files that need it, in particular
  118. X#    "src" files.
  119. X
  120. X$(SUBDIR):
  121. X    cd $@;  echo "    making $@";  $(MAKE) \
  122. X         OTHERLIB=$(OTHERLIB) INSROOT=$(INSROOT) all
  123. X
  124. Xsrc:
  125. X    cd src; echo " making src"; $(MAKE) \
  126. X         OTHERLIB=$(OTHERLIB) INSROOT=$(INSROOT) $(TARGET)
  127. X
  128. X#    "make install" installs mgr and all its support files and commands.
  129. X#    mgr is not made setuid-root.
  130. X
  131. Xinstall:    $(INSROOT)
  132. X    cd src; \
  133. X     $(MAKE) OTHERLIB=$(OTHERLIB) INSROOT=$(INSROOT) $(TARGET) install;
  134. X    for i in $(SUBDIR); do \
  135. X    (cd $$i; echo "    installing $$i";\
  136. X      $(MAKE)  OTHERLIB=$(OTHERLIB) INSROOT=$(INSROOT) install;\
  137. X     cd ..);\
  138. X    done    
  139. X
  140. X#    "make installasroot" runs "make install" as root.  mgr and some of the
  141. X#    support commands are made setuid-root.
  142. Xinstallasroot:
  143. X    /bin/su root -c '$(MAKE) OTHERLIB=$(OTHERLIB) INSROOT=$(INSROOT) \
  144. X        TARGET=$(TARGET) install'
  145. X
  146. X#    "make smallinstall" installs the mgr support commands which do not
  147. X#    have to be on the same machine as the mgr command.
  148. Xsmallinstall:    $(INSROOT)
  149. X    for i in $(SMALLDIR); do \
  150. X        (cd $$i; echo "    $@ing $$i";\
  151. X         $(MAKE)  OTHERLIB=$(OTHERLIB) INSROOT=$(INSROOT) $@;\
  152. X         cd ..);\
  153. X    done    
  154. X
  155. X$(INSROOT):
  156. X    mkdir $@
  157. X
  158. X#    "make clean" removes all intermediate files created by "make all".
  159. X#    "make clobber" removes all target files created by "make all".
  160. Xclean clobber:
  161. X    -rm font
  162. X    for i in $(ALLDIR); do \
  163. X        if [ -d $$i ]; then \
  164. X            (cd $$i; echo "    $@ing $$i";\
  165. X             $(MAKE)  INSROOT=$(INSROOT) $@;\
  166. X             cd ..);\
  167. X        fi; \
  168. X    done    
  169. X
  170. X#    "make list" outputs the complete list of files needed by "make all".
  171. X#    This list is also what goes into a delivery package.
  172. X#    This list is used by several scripts to keep track of stuff
  173. Xlist:
  174. X    @echo $(START)/README
  175. X    @echo $(START)/Makefile
  176. X    @for i in $(ALLDIR); do \
  177. X        echo "$(START)/$$i"; \
  178. X        if [ -d $$i ]; then \
  179. X            cd $$i; $(MAKE)  START=$(START)/$$i list; cd ..; \
  180. X        fi \
  181. X    done    
  182. X
  183. X
  184. X#    "make smalllist" outputs the list of files needed by "make small".
  185. X#    This list is also what goes into a "small" delivery package.
  186. Xsmalllist:
  187. X    @echo $(START)/README
  188. X    @echo $(START)/Makefile
  189. X    @echo $(START)/font
  190. X    @echo $(START)/font/default.fnt
  191. X    @echo $(START)/font/Makefile
  192. X    @for i in $(SMALLDIR); do \
  193. X        (cd $$i; echo "$(START)/$$i";\
  194. X         $(MAKE)  START=$(START)/$$i list;\
  195. X         cd ..);\
  196. X    done    
  197. X
  198. X#    "make cpio" creates a file containing a complete delivery package.
  199. Xcpio:
  200. X    $(MAKE) -s list | $(CPIO) -$(CPIO_OPTS) > $(CPIO_OUT)
  201. X
  202. X#    "make smallcpio" creates a file containing a "small" delivery package.
  203. Xsmallcpio:
  204. X    $(MAKE) -s smalllist | $(CPIO) -$(CPIO_OPTS) > $(CPIO_OUT).small
  205. X
  206. X
  207. X#    The FRC target forces items to remake.  Thus "make lib" will
  208. X#    issue the commands for the "lib" target, even though the lib directory
  209. X#    exists.
  210. Xsrc $(SUBDIR):    FRC
  211. X
  212. XFRC:
  213. X
  214. X#    for GNU make
  215. X.PHONY:    src $(SUBDIR)
  216. X.PHONY:    clean list fast cpio smallcpio install smallinstall
  217. END_OF_FILE
  218. # end of 'Makefile'
  219. fi
  220. if test -f 'demo/misc/clock.c' -a "${1}" != "-c" ; then 
  221.   echo shar: Will not clobber existing file \"'demo/misc/clock.c'\"
  222. else
  223. echo shar: Extracting \"'demo/misc/clock.c'\" \(5310 characters\)
  224. sed "s/^X//" >'demo/misc/clock.c' <<'END_OF_FILE'
  225. X/*                        Copyright (c) 1987 Bellcore
  226. X *                            All Rights Reserved
  227. X *       Permission is granted to copy or use this program, EXCEPT that it
  228. X *       may not be sold for profit, the copyright notice must be reproduced
  229. X *       on copies, and credit should be given to Bellcore where it is due.
  230. X *       BELLCORE MAKES NO WARRANTY AND ACCEPTS NO LIABILITY FOR THIS PROGRAM.
  231. X */
  232. X/*    $Header: clock.c,v 4.2 88/06/22 14:37:25 bianchi Exp $
  233. X    $Source: /tmp/mgrsrc/demo/misc/RCS/clock.c,v $
  234. X*/
  235. Xstatic char    RCSid_[] = "$Source: /tmp/mgrsrc/demo/misc/RCS/clock.c,v $$Revision: 4.2 $";
  236. X
  237. X/* get today's date */
  238. X
  239. X#include <errno.h>
  240. X#include <time.h>
  241. X#include <signal.h>
  242. X#include "term.h"
  243. X
  244. X#define FONT        14            /* default font */
  245. X#define POLL        15            /* poll interval */
  246. X#define FIX(x)        ((x)>12?(x)-12:(x))
  247. X#define dprintf        if (debug) fprintf
  248. X
  249. Xstatic char line[MAXLINE];
  250. Xstatic int x, y;        /* starting coord for clock */
  251. Xstatic int fired = 0;        /* alarm fired */
  252. Xstatic int armed = 0;        /* alarm armed */
  253. Xstatic int covered = 0;        /* window is covered */
  254. Xstatic int fx, fy;        /* font size */
  255. Xstatic int wx, wy;        /* window size */
  256. Xstatic char *alarm_time = NULL;
  257. Xstatic int debug;
  258. X
  259. Xstatic struct menu_entry enable[] = {
  260. X    "ALARM CLOCK","",
  261. X    "enable alarm","+\r",
  262. X};
  263. X
  264. Xstatic struct menu_entry disable[] = {
  265. X    "ALARM CLOCK","",
  266. X    "disable alarm","-\r",
  267. X};
  268. X
  269. Xmain(argc,argv)
  270. Xint argc;
  271. Xchar **argv;
  272. X   {
  273. X   int update(), clean();
  274. X   char *today();
  275. X   char buff[MAXLINE];
  276. X   int f_flag=0, s_flag=0, b_flag=0;
  277. X   int font;
  278. X   register int i;
  279. X   char *getenv();
  280. X
  281. X   ckmgrterm( *argv );
  282. X
  283. X   debug = (getenv("DEBUG") != NULL);
  284. X   for(i=1;i<argc;i++)
  285. X      if (*argv[i] == '-') switch (argv[i][1]) {
  286. X         case 'f':    /* -f<fontnumber>   select alternate font */
  287. X         f_flag++;
  288. X         font=atoi(argv[i]+2);
  289. X         break;
  290. X         case 'b':    /* -b   bury the window immediately */
  291. X         b_flag++;
  292. X         break;
  293. X         case 's':    /* -s   don't resize window, center the display */
  294. X         s_flag++;
  295. X         break;
  296. X         }
  297. X      else {
  298. X         alarm_time = argv[i];
  299. X         dprintf(stderr,"Setting alarm time to: %s\n",alarm_time);
  300. X         armed=1;
  301. X         };
  302. X
  303. X   m_setup(0);
  304. X   signal(SIGALRM,update);
  305. X   signal(SIGINT,clean);
  306. X   signal(SIGTERM,clean);
  307. X   m_ttyset();
  308. X   if (armed) {
  309. X      m_push(P_MENU|P_EVENT|P_FLAGS|P_FONT);
  310. X      menu_load(1,2,enable);
  311. X      menu_load(2,2,disable);
  312. X      m_selectmenu(1+armed);
  313. X      }
  314. X   else
  315. X      m_push(P_EVENT|P_FLAGS|P_FONT);
  316. X   m_setmode(M_NOWRAP);
  317. X   m_setmode(M_ABS);
  318. X   m_setevent(BUTTON_1,"A\r");
  319. X   m_setevent(BUTTON_1U,"X\r");
  320. X   m_setevent(RESHAPE,"X\r");
  321. X   m_setevent(REDRAW,"X\r");
  322. X   m_setevent(COVERED,"C\r");
  323. X   m_setevent(UNCOVERED,"E\r");
  324. X
  325. X   if (f_flag)
  326. X      m_font(font);
  327. X   else
  328. X      m_font(FONT);
  329. X   if (!s_flag)
  330. X      m_size(5,1);
  331. X   if (b_flag)
  332. X      m_clearmode(M_ACTIVATE);
  333. X
  334. X   setxy();
  335. X   update();
  336. X   while (1) {
  337. X      extern int   errno;
  338. X
  339. X      errno = 0;
  340. X      *line = '\0';
  341. X      if (m_gets(line) == NULL  &&  errno  &&  errno != EINTR)
  342. X         clean();
  343. X      alarm(0);
  344. X      dprintf(stderr,"Got: %s\n",line);
  345. X      switch (*line) {
  346. X         case 'C':            /* covered */
  347. X            covered = 1;
  348. X            break;
  349. X         case 'E':            /* exposed */
  350. X            covered = 0;
  351. X            break;
  352. X         case '+':            /* enable alarm */
  353. X            dprintf(stderr,"Arming alarm\n");
  354. X            armed = 1;
  355. X            m_selectmenu(armed+1);
  356. X            m_flush();
  357. X            break;
  358. X         case '-':            /* disable alarm */
  359. X            dprintf(stderr,"Disarming alarm\n");
  360. X            armed = 0;
  361. X            fired = 0;
  362. X            m_selectmenu(armed+1);
  363. X            m_flush();
  364. X            break;
  365. X         case 'A':            /* show alarm time */
  366. X            if (alarm_time) {
  367. X               m_moveprint(x,y,alarm_time);
  368. X               m_movecursor(wx+fx,y);
  369. X               m_flush();
  370. X               m_gets(line);
  371. X               fired = 0;
  372. X               }
  373. X            break; 
  374. X         case 'X':            /* redraw, reshape */
  375. X            setxy();
  376. X            break;
  377. X         }
  378. X      update();
  379. X      }
  380. X   }
  381. X
  382. Xint
  383. Xupdate()
  384. X   {
  385. X   char *today();
  386. X   char *s = today();
  387. X   m_moveprint(x,y,s);
  388. X   m_movecursor(wx+fx,y);
  389. X   if (fired || (armed && alarm_time && strcmp(alarm_time,s)==0)) {
  390. X      dprintf(stderr,"Fireing alarm %s\n",fired?"":"FIRST TIME");
  391. X      fired = 1;
  392. X      if (covered) {
  393. X         m_setmode(M_NOINPUT);
  394. X         m_setmode(M_ACTIVATE);
  395. X         }
  396. X      m_setmode(M_WOB);
  397. X      m_printstr("\007");
  398. X      m_flush();
  399. X      sleep(2);
  400. X      m_clearmode(M_WOB);
  401. X      if (covered) {
  402. X         m_clearmode(M_ACTIVATE); 
  403. X         m_clearmode(M_NOINPUT);
  404. X         }
  405. X      }
  406. X   m_flush();
  407. X   signal(SIGALRM,update);
  408. X   alarm(POLL);
  409. X   }
  410. X   
  411. Xchar * 
  412. Xtoday()
  413. X   {
  414. X   struct tm *tme, *localtime();
  415. X   static char result[9];
  416. X   long tmp,time();
  417. X
  418. X   tmp = time(0);
  419. X   tme = localtime(&tmp);
  420. X   sprintf(result,"%02d:%02d",FIX(tme->tm_hour),tme->tm_min);
  421. X   return(result);
  422. X   }
  423. X
  424. Xclean()
  425. X   {
  426. X   m_pop(0);
  427. X   m_ttyreset();
  428. X   exit(1);
  429. X   }
  430. X
  431. Xsetxy()
  432. X   {
  433. X   char *today();
  434. X
  435. X   get_font(&fx,&fy);
  436. X   get_size(0,0,&wx,&wy);
  437. X   x = (wx - strlen(today())*fx)/2;
  438. X   y = fy + (wy - fy)/2;
  439. X   if (x<0) x = 0;
  440. X   if (y<0) y = 0;
  441. X   m_clear();
  442. X   dprintf(stderr,"Setting %d x %d at %d x %d in %d x %d\n",
  443. X          strlen(today())*fx,fy,x,y,wx,wy);
  444. X   m_flush();
  445. X   }
  446. END_OF_FILE
  447. # end of 'demo/misc/clock.c'
  448. fi
  449. if test -f 'doc/zoom.1' -a "${1}" != "-c" ; then 
  450.   echo shar: Will not clobber existing file \"'doc/zoom.1'\"
  451. else
  452. echo shar: Extracting \"'doc/zoom.1'\" \(5172 characters\)
  453. sed "s/^X//" >'doc/zoom.1' <<'END_OF_FILE'
  454. X'\"                        Copyright (c) 1988 Bellcore
  455. X'\"                            All Rights Reserved
  456. X'\"       Permission is granted to copy or use this program, EXCEPT that it
  457. X'\"       may not be sold for profit, the copyright notice must be reproduced
  458. X'\"       on copies, and credit should be given to Bellcore where it is due.
  459. X'\"       BELLCORE MAKES NO WARRANTY AND ACCEPTS NO LIABILITY FOR THIS PROGRAM.
  460. X'\"
  461. X'\"    $Header: zoom.1,v 4.1 88/06/21 13:56:26 bianchi Exp $
  462. X'\"    $Source: /tmp/mgrsrc/doc/RCS/zoom.1,v $
  463. X.TH zoom 1L "June 10, 1986"
  464. X.SH NAME
  465. Xzoom \- an icon editor for
  466. X.I mgr
  467. X.SH SYNOPSIS
  468. X.B zoom
  469. X<\fBicon file\fP> ...
  470. X.SH DESCRIPTION
  471. X.B zoom
  472. Xis a mouse driven icon editter for
  473. X.I mgr.
  474. X.B Zoom
  475. Xdivides the window into three regions, a banner line at the top containing
  476. Xfour status fields,
  477. Xa message line at the bottom,
  478. Xand the remainder of the window for an enlarged, or
  479. X.I zoomed
  480. Xrepresentation of
  481. X.I <icon>
  482. Xbeing editted.
  483. XIf the first file given on the command line is not an icon,
  484. Xzoom prompts for its width and height.
  485. X.LP
  486. XThe current state of zoom is indicated by the four status fields in the
  487. Xbanner line.
  488. X.TP
  489. X*
  490. XThe first, or
  491. X.I raster function
  492. Xfield displays the current raster-op function to be applied to the next
  493. Xedit operation.  This function may be changed with the pop-up menu,
  494. Xactivated by pressing the middle mouse button while the mouse track is in the 
  495. X.I raster function
  496. Xfield.
  497. XNormally the choices are 
  498. X.B set, clear, toggle
  499. Xand
  500. X.B grid.
  501. XThe first three are raster-op functions; the
  502. X.I grid
  503. Xoption toggles the bitmap alignment grid.
  504. XIf the
  505. X.B put
  506. Xcommand is pending (see below), the raster-op choices become
  507. X.B copy, paint mask,
  508. Xand
  509. X.B exclusive-or. 
  510. X.TP
  511. X*
  512. XThe second, or
  513. X.I edit
  514. Xfield displays one of the six possible edit functions:
  515. X.B Yank, Put, Shrink, Grow, Fix,
  516. Xand
  517. X.B  Undo.
  518. XFix and Undo are performed when selected. 
  519. X.B Fix
  520. Xchanges the window size
  521. Xto give square pixels. 
  522. X.B Undo
  523. Xun-does the previous edit operation.
  524. XIf any of the other functions is selected, it becomes the pending function,
  525. Xand is highlighted.
  526. XWhen a function is pending, the next sweep operation performs that function
  527. Xon the group of pixels enclosed by the sweeping rectangle (the 
  528. X.I selected
  529. Xpixels).
  530. X.RS
  531. X.TP
  532. X.B Yank
  533. Xcopies the 
  534. X.I selected
  535. Xpixels into the yank buffer.
  536. X.TP
  537. X.B Put
  538. Xcombines the yank buffer with the 
  539. X.I selected
  540. Xpixels in a manner determined
  541. Xby the current
  542. X.I raster function
  543. Xfield.
  544. X.TP
  545. X.B Shrink
  546. Xmakes the icon smaller by scaling the selected pixels to fill the entire
  547. Xwindow.
  548. X.TP 
  549. X.B Grow
  550. Xmakes the icon bigger by scaling the entire icon to fit into the
  551. Xselected pixel region.
  552. X.RE
  553. X.TP 
  554. X*
  555. XThe Third or
  556. X.I size
  557. Xfield displays the current 
  558. X.I width
  559. Xand
  560. X.I height
  561. Xof the icon, in pixels.
  562. XThe size of the icon may be changed by selecting the pop-up menu
  563. Xwhen the mouse track is in the
  564. X.I size
  565. Xfield
  566. Xand responding to the prompt.
  567. XWhile in the prompt window, the menu permits the selection
  568. Xof several standard icon sizes.
  569. X.TP
  570. X*
  571. XThe fourth, and final field is the
  572. X.I file
  573. Xfield.
  574. XThe
  575. X.I file
  576. Xfield displays the current file name of the icon.
  577. XThe filing options
  578. X.B Save, Get, Yank,
  579. Xand
  580. XQuit
  581. Xare, as usual, accessed by a pop-up menu when the mouse track
  582. Xis in the
  583. X.I file
  584. Xfield.
  585. XThe
  586. X.I file
  587. Xoptions prompt for a file name.  
  588. XA list of all of the files specified on the command line
  589. Xis available via the pop-up menu within the prompt window.
  590. X.RS
  591. X.TP
  592. X.B
  593. XSave
  594. Xsaves the icon by the specified name.
  595. X.TP
  596. X.B Get
  597. Xedits a new icon , tossing the current icon into the bit-bucket.
  598. X.TP
  599. X.B Yank
  600. Xcopies the specified icon into the
  601. X.I yank 
  602. Xbuffer for use with the
  603. X.B put
  604. Xcommand.
  605. X.TP
  606. X.B Quit
  607. Xquits
  608. XZoom. Quit does
  609. X.B NOT
  610. Xsave the icon.  A save must be explicitly issued first.
  611. XZoom may also be terminated by typing
  612. X"Q\er" to the window, or hitting your favorite interrupt key.
  613. X.RE
  614. X.LP
  615. XFor those who are not particularly font of rodents, all of the
  616. X.B zoom 
  617. Xcommands may be accessed via 1 or 2 letter keyboard commands
  618. X(followed by a \er), some of which
  619. Xare:
  620. X
  621. X     R    Repaint window
  622. X     x    toggle alignment grid
  623. X     w    FIX window aspect ratio
  624. X     u    UNDO
  625. X
  626. X     s1    select SET mode
  627. X     s2    select CLEAR mode
  628. X     s3    select TOGGLE mode
  629. X
  630. X     f    SAVE file
  631. X     g    GET a new file
  632. X     y    YANK a file
  633. X     Q    QUIT
  634. X
  635. X     F1    select YANK function
  636. X     F2    select PUT function
  637. X     F3    SHRINK icon
  638. X     F4    GROW icon
  639. X
  640. X     P0    set COPY mode
  641. X     P1    set PAINT mode
  642. X     P2    set MASK mode
  643. X     P3    set XOR mode
  644. X
  645. X.LP
  646. XOkay, now to edit the icon.
  647. X.TP 
  648. X*
  649. XPressing the middle button and moving it either sets or clears the pixels
  650. Xit passes over.  If the first pixel it touches is clear, the pixels will
  651. Xbe set; if it is set, all touched pixels will be cleared.
  652. X.TP
  653. X*
  654. XHolding, moving, then releasing the right mouse button sweeps out
  655. Xa rectangular region of
  656. X.I selected pixels.
  657. XIf no function is currently highlighted in the 
  658. X.I edit
  659. Xfield,
  660. Xthe current raster-op function is performed on 
  661. Xthe selected pixels.
  662. XOtherwise, the highlighted function is performed.
  663. X.SH BUGS
  664. X.TP 3
  665. X*
  666. XZoom works best on small icons, running on the local machine.
  667. X.TP 3
  668. X*
  669. XYou can't view the actual size of the icon being editted.
  670. X.TP 3
  671. X*
  672. XIcon coordinates must be typed in exactly in the form of
  673. X.B x
  674. X,
  675. X.B y
  676. Xwith no spaces or tabs.
  677. X.SH SEE ALSO
  678. Xbrowse(1L)
  679. Xdump(5L)
  680. Xmgr(1L)
  681. END_OF_FILE
  682. # end of 'doc/zoom.1'
  683. fi
  684. if test -f 'font-32/Ugal12x20b' -a "${1}" != "-c" ; then 
  685.   echo shar: Will not clobber existing file \"'font-32/Ugal12x20b'\"
  686. else
  687. echo shar: Extracting \"'font-32/Ugal12x20b'\" \(5330 characters\)
  688. sed "s/^X//" >'font-32/Ugal12x20b' <<'END_OF_FILE'
  689. Xbegin 644 gal12x20b.fnt
  690. XM& P4!8                                                      
  691. XM              !P'< [!P/'!X#@ ..            '!X P'X#\ <#^!X'_
  692. XM#X#\          #X                                            
  693. XM          !^< ?@!@   8  ,    '   \  &     < 'P              
  694. XM               >!P/                                         
  695. XM                              !P'< ['\9N#\'P <'            .
  696. XM#\!P/\'^ \#^#@/_&<&>          '\  !P_X#^_X?^?^#^^/'\'\^/? \'
  697. XMX'#X?\#X_X'_?_^'\/__^'^'/_!^< ?@#P   X  <    /  !N  . !P .\ 
  698. XM!P                             X!P#@                        
  699. XM                                              !P'< [/^9N'.'P
  700. XM \'@           .&<#P<>,/ \& ' <&..,/          />  !P<,&'<>.&
  701. XM.&&'<'!P!P<<. </<#&>..&><<.'9S<#<&=S<#<#,.!P. #@'X  !P  \   
  702. XM '  !N  > !P .< !P              !@             X!P#@        
  703. XM                                                            
  704. XM  !P'<!W=_9\'.!P X#@           <&.'P8.8'!\& .  &..<'        
  705. XM  ,.#\#X<.,#<..&.&,#<'!P!P<X. >/>#,..',.<.<#!P<#.,=S.&.& .!P
  706. XM. #@.<  !P  <    '  #@  .     < !P              !@          
  707. XM   <!P'                                                     
  708. XM                  !P'<'_=W/<'.!P!X#P#X         <../P . '!\, 
  709. XM.  ...<'           ./^#X<., <'. . , <'!P!P=P. >/?#,'.','<.<#
  710. XM!P<#.,=S/,', <!P' #@<.  !\  <    '  #@  .     < !P          
  711. XM    #@             <!P'                                     
  712. XM                                  !P'<'_=P X#\#@!P!P!P!P    
  713. XM   X..!P . /#</\<  ,',<'#@   '  <  ..'#8<.< <'. . < <'!P!P?@
  714. XM. >/?#<'.'<'<.> !P<#.,?S',', <!P' #@    !\#\=\'\#_#X#@'[/\'P
  715. XM ^<>!P_^-\#\_\#[>\'^?^??^'___/^/?_ <!P'                     
  716. XM                                                  !P  #N/P X
  717. XM'P' !P!P=W!P       X..!P .!^#<.>=\ ,#X>/'P#@ >  /  <<'&<<<< 
  718. XM<'.,.,< <'!P!P? . ??;C<'..<'<,/@!P<#'8?^#X#X X!P#@#@     X'.
  719. XM?^.>.?..#@.?/>!P .<X!P?_?>&>>>&?/N..#@..<#=S>&<#</ X!P#@    
  720. XM                                                            
  721. XM      !P  #N'\!P/P& !P!P?_!P      !P..!P <#^&< /?^ <!P/_'P'P
  722. XM!X?^'P X=[&<?\< <'/\/\< ?_!P!P? . ??9S<'/\<'?X'P!P<#'8.^!P!P
  723. XM X!P#@#@      &.>/,.,/<''\<...!P .=P!P=W..,/</,//..&#@...&=S
  724. XM/,.&8>!X!P#P                                                
  725. XM                      !P  '<!^#@?X  !P!P'<!P      #@..!P X /
  726. XM&< '>/ 8#X'W#@'P'P?^!\!P?_&,<.< <'.,.,< <'!P!P?@. ??9[<'. <'
  727. XM?@!\!P<#'8/^!P!P!P!P!P#@       ^<'< <'<'#@<...!P .?@!P=W..<'
  728. XM<'<'. / #@...&=S'X.& \ X!P#@'C                              
  729. XM                                      !P  '<!W#@<_  !P!P  ?_
  730. XM  ?_  #@..!P!P ',< '<' 8&< '  #@?    ?#@?O/^<'< <'. . <?<'!P
  731. XM!P?P. ;_8[<'. <'?P >!P<##@/^#X!P!P!P X#@      'N<'< <'?_#@<.
  732. XM..!P .? !P=W..<'<'<'. 'P#@..',/^#P',!X <!P' /W              
  733. XM                                                      !P  ?^
  734. XM!W'><?  !X#P'<?_  ?_  ' ..!P#@ '/_ '<' X.. .    ?    ?#@?O,.
  735. XM<'< <'. . <'<'!P!P=X. ;W8?<'. <'=X /!P<##P/\&<!P#@!P X#@    
  736. XM  ..<'< <'< #@.<..!P .?@!P=W..<'<'<'. !\#@..',/^!X',#P <!P' 
  737. XM/^                                                          
  738. XM              ?^=W'S<>   X#@?_!P    #@' .,!P' 8'?_8'<' P.. .
  739. XM#@  'P?^!\  =_,&<', <'. . ,'<'!P!P<\. ;W8/,&. .&<\8'!P<##P'<
  740. XM&>!P#@!P <#@      ..<'< <'< #@/X..!P .?P!P=W..<'<'<'.  >#@..
  741. XM#X/^#\#X'@ <!P' =^                                          
  742. XM                              .X?^.S<<   \'@=W!P#@  'P. ',!P
  743. XM.#<& <<'>& P.. <'P#@!X?^'P  < 8'<'.#<&.#. .'<'!P!P<>.#9G8/.&
  744. XM. /&<>8'!P>&!@'<,.!P' !P <#@      ..>'>&>/. #@< ..!P .=X!P=W
  745. XM..>&<&>'. ,.#C..#X'<&>#X/# X!P#@8\                          
  746. XM                                          !P  =P/\.S/_   <' 
  747. XM!P!P'P  'P. 'X!P?_/\ <../\!P',!X'P'P >  / #@. 8'<.'&<<.#. ''
  748. XM<'!P!P</.#9G8'',. '\</<.!P/^!@'<8'!P'#!^ .?@      />?.../?''
  749. XM#@?^..!P .<\!P=W../,>,//. ..#V/>!P'<,/!P>' X!P#@            
  750. XM                                                          !P
  751. XM  =P!P<>'W   .. #X!P'P  #@< #P/^?_'X <'\'X!@#X/@#@'P '  < #@
  752. XM/_\/_\#\_P?_? #\^/'\!P^'?_]O\##X? #P^'?\'\'\!@'<\/#X/_!^ .?@
  753. XM      '_;\'\'W#\'P/_??'\ .^?'\__??'X?X'_? /\!\'W!P'<^?!P?_ >
  754. XM!P/                                                         
  755. XM                                    !P                      
  756. XM      !P        #_                  !P            'X        
  757. XM                                  ,'    ,.          <  '    
  758. XM          !@    !P                                          
  759. XM                                                    !P      
  760. XM                      !P                            !P      
  761. XM      ,]                          __              8#    ..  
  762. XM        <  '              #@    !P                          
  763. XM                                                            
  764. XM        #@                            #@                    
  765. XM        !@             ?                          __        
  766. XM      8#    /,          <  '              #     !P          
  767. XM                                                            
  768. XM                        '                             '     
  769. XM                        /                                   
  770. XM                      ?^    'X          <  '              ? 
  771. XM    !P                                                      
  772. XM                                        &                   
  773. XM          &                             .                   
  774. XM                                      /\    #P          ^  /
  775. X5              >     !P      
  776. Xend
  777. END_OF_FILE
  778. # end of 'font-32/Ugal12x20b'
  779. fi
  780. if test -f 'font-32/Ugal12x20r' -a "${1}" != "-c" ; then 
  781.   echo shar: Will not clobber existing file \"'font-32/Ugal12x20r'\"
  782. else
  783. echo shar: Extracting \"'font-32/Ugal12x20r'\" \(5330 characters\)
  784. sed "s/^X//" >'font-32/Ugal12x20r' <<'END_OF_FILE'
  785. Xbegin 644 gal12x20r.fnt
  786. XM& P4!8                                                      
  787. XM              !@&8 S!@.&!P#  ,,            &!P @'P#X 8#\!P'^
  788. XM#P#X          #P                                            
  789. XM          !\8 ? !    0  (    &   X  $     8 '@              
  790. XM               <!@.                                         
  791. XM                              !@&8 S'X1,#X'@ 8&            ,
  792. XM#X!@/X'\ X#\# /^$8$<          'X  !@_P#\_P?\?\#\\/'X'X\.> X'
  793. XMP'#P?X#P_P'^?^\'X._O\'\'/^!\8 ? #@   P  8    .  !,  , !@ ,X 
  794. XM!@                             P!@#                         
  795. XM                                              !@&8 S/\1,&,'@
  796. XM X'            ,$8#@8<(. X$ & 8$,,(.          .<  !@8($&8<,$
  797. XM,$$&8&!@!@88, 8.8"$<,,$<88,&1B8"8$9B8"8"(,!@, # &P  !@  X   
  798. XM &  !,  < !@ ,8 !@              !              P!@#         
  799. XM                                                            
  800. XM  !@&8!F9N18&,!@ P#            8$,'@0,0&!8$ ,  $,,8&        
  801. XM  (,#X"P8,("8,,$,$("8&!@!@8P, <.<"(,,&(,8,8"!@8",(9B,$,$ ,!@
  802. XM, # ,8  !@  8    &  #   ,     8 !@              !           
  803. XM   8!@&                                                     
  804. XM                  !@&8'_9F.8&,!@!P#@#P         8,,-@ , &!8( 
  805. XM,  ,,,8&           ,/\"P8,( 8&, , ( 8&!@!@9@, <.>"(&,&(&8,8"
  806. XM!@8",(9B.(&( 8!@& # 8,  !X  8    &  #   ,     8 !@          
  807. XM    #              8!@&                                     
  808. XM                                  !@&8'_9@ P#X# !@!@!@!@    
  809. XM   P,,!@ , ."8/X8  (&(8&#    &  8  ,,&"08,8 8&, , 8 8&!@!@; 
  810. XM, <.6"8&,&8&8,< !@8",(=B&(&( 8!@& #     !X#X9X'X#V#P# 'R-X'@
  811. XM \8<!@W<)X#X[X#R<X'\?\>>\'_W^/\/?^ 8!@&                     
  812. XM                                                  !@  #,/@ P
  813. XM'@& !@!@9F!@       P,,!@ ,!\"8,<9X (#0<.'@#  <  .  88&$8888 
  814. XM8&,(,(8 8&!@!@> , 663"8&,,8&8(/ !@8"&0=T#0#0 P!@# #      P&,
  815. XM;\,<,>,,# ,>.<!@ ,8P!@;N><$<<<$>-,,,# ,,8"9B<$8"8. P!@#     
  816. XM                                                            
  817. XM      !@  #,'X!@/@$ !@!@=N!@      !@,,!@ 8#\$8 .;\ 8!@/V'@'@
  818. XM!P?\'@ P9R$8?X8 8&/X/X8 ?^!@!@> , 661B8&-X8&?P'@!@8"&0,T!@!@
  819. XM P!@# #       $,<.(,(.8&'X8,,,!@ ,9@!@9F,,(.8.(..,,$# ,,,$9B
  820. XM.(,$0<!P!@#@                                                
  821. XM                      !@  &8!\# =P  !@!@&8!@      # ,,!@ P .
  822. XM$8 &<. 0"P'F# '@'@?\!X!@;Z$(8,8 8&,(,(8 8&!@!@? , 661R8&, 8&
  823. XM? !X!@8"&0-T!@!@!@!@!@#        \8&8 8&8&# 8,,,!@ ,? !@9F,,8&
  824. XM8&8&, . # ,,,$9B'0,$ X P!@# '"                              
  825. XM                                      !@  &8!F# 8V  !@!@  ?^
  826. XM  ?^  # ,,!@!@ &(8 &8& 0$8 &  # >    ># ;*/\8&8 8&, , 8?8&!@
  827. XM!@;@, 360R8&, 8&;@ <!@8"# .\"P!@!@!@ P#       ',8&8 8&?^# 8,
  828. XM,,!@ ,> !@9F,,8&8&8&, '@# ,,&(-T#@&(!P 8!@& /F              
  829. XM                                                      !@  ?\
  830. XM!F&<8>  !P#@&8?^  ?^  & ,,!@#  &/^ &8& P,, ,    >    ># ;*(,
  831. XM8&8 8&, , 8&8&!@!@9P, 3F0:8&, 8&9P .!@8"#@.X$8!@# !@ P#     
  832. XM  ,,8&8 8&8 # ,8,,!@ ,? !@9F,,8&8&8&, !X# ,,&(.T!P&(#@ 8!@& 
  833. XM-L                                                          
  834. XM              ?\9F&B8<   P# =N!@    # & ,(!@& 0&?^0&8& @,, ,
  835. XM#   '@?\!X  9^($8&( 8&, , (&8&!@!@8X, 3F0.($, ,$8X0&!@8"#@&8
  836. XM$<!@# !@ 8#       ,,8&8 8&8 # /P,,!@ ,;@!@9F,,8&8&8&,  <# ,,
  837. XM#0.T"X#0'  8!@& 9\                                          
  838. XM                              ,P?\,B88   X' 9F!@#   '@, &(!@
  839. XM,"8$ 88&<$ @,, 8'@# !P?\'@  8 0&8&,"8$,", ,&8&!@!@8<,"1&0.,$
  840. XM, .$8<0&!@<$! &8(,!@& !@ 8#       ,,<&<$<., # 8 ,,!@ ,9P!@9F
  841. XM,,<$8$<&, (,#",,#0&8$<#0." P!@# 0X                          
  842. XM                                          !@  9@/X,B/^   8& 
  843. XM!@!@'@  '@, 'P!@?^/X 8,,/X!@&(!P'@'@ <  . # , 0&8,&$88,", &&
  844. XM8&!@!@8.,"1&0&&(, 'X8.8,!@/\! &80&!@&"!\ ,?       .<>,,,.6&&
  845. XM# ?\,,!@ ,8X!@9F,,.(<(.., ,,#D.<!@&8(.!@<& P!@#             
  846. XM                                                          !@
  847. XM  9@!@8<'F   ,, #P!@'@  # 8 #@/\?^'P 8'X'P! #P/ # '@ &  8 # 
  848. XM/^X/_X#X_@?^> #X\/'X!@\'?^Y/X##P> #@\'?X'X'X! &8X/#P/^!\ ,? 
  849. XM      'N3X'X'G#X'@/^>>'X ,\>'X[W>>'P?P'^> /X!X'F!@&8\?!@?^ <
  850. XM!@.                                                         
  851. XM                                    !@                      
  852. XM      !@        #^                  !@            'P        
  853. XM                                  (&    (,          8  &    
  854. XM          !     !@                                          
  855. XM                                                    !@      
  856. XM                      !@                            !@      
  857. XM      (Y                          __              0"    ,,  
  858. XM        8  &              #     !@                          
  859. XM                                                            
  860. XM        #                             #                     
  861. XM        !              >                          __        
  862. XM      0"    .(          8  &              "     !@          
  863. XM                                                            
  864. XM                        &                             &     
  865. XM                        .                                   
  866. XM                      ?\    'P          8  &              > 
  867. XM    !@                                                      
  868. XM                                        $                   
  869. XM          $                             ,                   
  870. XM                                      /X    #@          \  /
  871. X5              <     !@      
  872. Xend
  873. END_OF_FILE
  874. # end of 'font-32/Ugal12x20r'
  875. fi
  876. if test -f 'src/fast_scroll.c' -a "${1}" != "-c" ; then 
  877.   echo shar: Will not clobber existing file \"'src/fast_scroll.c'\"
  878. else
  879. echo shar: Extracting \"'src/fast_scroll.c'\" \(5271 characters\)
  880. sed "s/^X//" >'src/fast_scroll.c' <<'END_OF_FILE'
  881. X/*                        Copyright (c) 1987 Bellcore
  882. X *                            All Rights Reserved
  883. X *       Permission is granted to copy or use this program, EXCEPT that it
  884. X *       may not be sold for profit, the copyright notice must be reproduced
  885. X *       on copies, and credit should be given to Bellcore where it is due.
  886. X *       BELLCORE MAKES NO WARRANTY AND ACCEPTS NO LIABILITY FOR THIS PROGRAM.
  887. X */
  888. X/*    $Header: fast_scroll.c,v 4.1 88/06/21 13:22:00 bianchi Exp $
  889. X    $Source: /tmp/mgrsrc/src/RCS/fast_scroll.c,v $
  890. X*/
  891. Xstatic char    RCSid_[] = "$Source: /tmp/mgrsrc/src/RCS/fast_scroll.c,v $$Revision: 4.1 $";
  892. X
  893. X/*
  894. X * fast scroll for 68010 assuming byte boundaries  (SAU)
  895. X *    This code is highly machine dependent
  896. X */
  897. X
  898. X#include <stdio.h>
  899. X#include "bitmap.h"
  900. X
  901. X#define BYTESWIDE(x)    ((x->primary->wide+7)>>3)
  902. X
  903. X#ifndef mc68020
  904. X
  905. X/* these macros rely upon the proper register assignments */
  906. X
  907. X#define START(x)    asm("x:    movl    d7,d0")
  908. X#define LOOP(l)        asm("l:    movw    a3@+,a4@+"); \
  909. X            asm("    dbf    d0,l")
  910. X#define GOTO(x)        asm("    dbf    d5,x")
  911. X#define SKIP()        asm("    addl    d6,a4"); \
  912. X            asm("    addl    d6,a3")
  913. X#define BYTE()        asm("    movb    a3@+,a4@+")
  914. X#define ADJ(x)        asm("    subql    #x,d7")
  915. X
  916. Xfast_scroll(map,x,y,wide,high,delta)
  917. Xregister BITMAP *map;                    /* a5 */
  918. Xint x,y,wide,high,delta;
  919. X   {
  920. X   register unsigned char *dst = (unsigned char *)     /* a4 */
  921. X         ((long) (map->data) + (y*BYTESWIDE(map) + (x>>3)));
  922. X   register unsigned char *src =            /* a3 */
  923. X         dst + (delta*BYTESWIDE(map));
  924. X   register long count =                /* d7 */
  925. X         (wide>>4) - 1;            /* # of shorts - 1 for inner dbf */
  926. X   register long skip =                 /* d6 */
  927. X         BYTESWIDE(map)-(wide>>3);    /* bytes to skip at right edge */
  928. X   register long h =                     /* d5 */
  929. X         high-delta-1;            /* # of lines to scroll */
  930. X   int which = (((long) dst)&1) + ((skip&1)<<1);
  931. X
  932. X   switch (which) {
  933. X      case 0:            /* skip&1 == 0 */
  934. X     START(C0); LOOP(LP0); SKIP(); GOTO(C0);
  935. X         break;
  936. X      case 1:
  937. X         ADJ(1); START(C1); BYTE(); LOOP(LP1); BYTE(); SKIP(); GOTO(C1);
  938. X         break;
  939. X
  940. X      case 2:            /* skip&1 == 1 */
  941. X     START(C2); LOOP(LP2); BYTE(); SKIP(); GOTO(C2);
  942. X         break;
  943. X      case 3:
  944. X     START(C3); BYTE(); LOOP(LP3); SKIP(); GOTO(C3);
  945. X         break;
  946. X      }
  947. X   }
  948. X
  949. X/*
  950. X * fast scroll for 68020 assuming byte boundaries  (SAU)
  951. X *    This code is highly machine dependent
  952. X */
  953. X
  954. X#else
  955. X
  956. X/* these macros rely upon the proper register assignments */
  957. X
  958. X#define START(x)    asm("x:    movl    d7,d0")
  959. X#define LOOP(l)        asm("l:    movl    a3@+,a4@+"); \
  960. X            asm("    dbf    d0,l")
  961. X#define GOTO(x)        asm("    dbf    d5,x")
  962. X#define SKIP()        asm("    addl    d6,a4"); \
  963. X            asm("    addl    d6,a3")
  964. X#define WORD()        asm("    movw    a3@+,a4@+")
  965. X#define BYTE()        asm("    movb    a3@+,a4@+")
  966. X#define ADJ(x)        asm("    subql    #x,d7")
  967. X
  968. Xfast_scroll(map,x,y,wide,high,delta)
  969. Xregister BITMAP *map;                    /* a5 */
  970. Xint x,y,wide,high,delta;
  971. X   {
  972. X   register unsigned char *dst = (unsigned char *)     /* a4 */
  973. X         ((long) (map->data) + (y*BYTESWIDE(map) + (x>>3)));
  974. X   register unsigned char *src =            /* a3 */
  975. X         dst + (delta*BYTESWIDE(map));
  976. X   register long count =                /* d7 */
  977. X         (wide>>5) - 1;            /* # of longs - 1 for inner dbf */
  978. X   register long skip =                 /* d6 */
  979. X         BYTESWIDE(map)-(wide>>3);    /* bytes to skip at right edge */
  980. X   register long h =                     /* d5 */
  981. X         high-delta-1;            /* # of lines to scroll */
  982. X   int which = (((long) dst)&3) + ((skip&3)<<2);
  983. X
  984. X   switch (which) {
  985. X      case 0:            /* skip&3 == 0 */
  986. X     START(C0); LOOP(LP0); SKIP(); GOTO(C0);
  987. X         break;
  988. X      case 1:
  989. X         ADJ(1); START(C1); BYTE(); WORD(); LOOP(LP1); BYTE(); SKIP(); GOTO(C1);
  990. X         break;
  991. X      case 2:
  992. X         ADJ(1); START(C2); WORD(); LOOP(LP2); WORD(); SKIP(); GOTO(C2);
  993. X         break;
  994. X      case 3:
  995. X         ADJ(1); START(C3); BYTE(); LOOP(LP3); WORD(); BYTE(); SKIP(); GOTO(C3);
  996. X         break;
  997. X
  998. X      case 4:            /* skip&3 == 1 */
  999. X     START(C4); LOOP(LP4); WORD(); BYTE(); SKIP(); GOTO(C4);
  1000. X         break;
  1001. X      case 5:
  1002. X     START(C5); BYTE(); WORD(); LOOP(LP5); SKIP(); GOTO(C5);
  1003. X         break;
  1004. X      case 6:
  1005. X     START(C6); WORD(); LOOP(LP6); BYTE(); SKIP(); GOTO(C6);
  1006. X         break;
  1007. X      case 7:
  1008. X     START(C7); BYTE(); LOOP(LP7); WORD(); SKIP(); GOTO(C7);
  1009. X         break;
  1010. X
  1011. X      case 8:            /* count%4 == 2 */
  1012. X     START(C8); LOOP(LP8); WORD(); SKIP(); GOTO(C8);
  1013. X         break;
  1014. X      case 9:
  1015. X         ADJ(1); START(C9); BYTE(); WORD(); LOOP(LP9);
  1016. X         WORD(); BYTE(); SKIP(); GOTO(C9);
  1017. X         break;
  1018. X      case 10:
  1019. X     START(C10); WORD(); LOOP(LP10); SKIP(); GOTO(C10);
  1020. X         break;
  1021. X      case 11:
  1022. X     START(C11); BYTE(); LOOP(LP11); BYTE(); SKIP(); GOTO(C11);
  1023. X         break;
  1024. X
  1025. X      case 12:            /* count%4 == 3 */
  1026. X     START(C12); LOOP(LP12); BYTE(); SKIP(); GOTO(C12);
  1027. X         break;
  1028. X      case 13:
  1029. X         ADJ(1); START(C13); BYTE(); WORD(); LOOP(LP13);
  1030. X         WORD(); SKIP(); GOTO(C13);
  1031. X         break;
  1032. X      case 14:
  1033. X         ADJ(1); START(C14); WORD(); LOOP(LP14); WORD();
  1034. X         BYTE(); SKIP(); GOTO(C14);
  1035. X         break;
  1036. X      case 15:
  1037. X     START(C15); BYTE(); LOOP(LP15); SKIP(); GOTO(C15);
  1038. X         break;
  1039. X      }
  1040. X   }
  1041. X
  1042. X/* normal bit-blit version of the above (for testing) */
  1043. X
  1044. XFast_scroll(map,x,y,wide,high,delta)
  1045. Xregister BITMAP *map;                    /* a5 */
  1046. Xint x,y,wide,high,delta;
  1047. X   {
  1048. X   bit_blit(map,x&7,y,wide&7,high,
  1049. X            BIT_SRC,map,x&7,delta);
  1050. X   }
  1051. X#endif
  1052. END_OF_FILE
  1053. # end of 'src/fast_scroll.c'
  1054. fi
  1055. if test -f 'src/get_text.c' -a "${1}" != "-c" ; then 
  1056.   echo shar: Will not clobber existing file \"'src/get_text.c'\"
  1057. else
  1058. echo shar: Extracting \"'src/get_text.c'\" \(5192 characters\)
  1059. sed "s/^X//" >'src/get_text.c' <<'END_OF_FILE'
  1060. X/*                        Copyright (c) 1987 Bellcore
  1061. X *                            All Rights Reserved
  1062. X *       Permission is granted to copy or use this program, EXCEPT that it
  1063. X *       may not be sold for profit, the copyright notice must be reproduced
  1064. X *       on copies, and credit should be given to Bellcore where it is due.
  1065. X *       BELLCORE MAKES NO WARRANTY AND ACCEPTS NO LIABILITY FOR THIS PROGRAM.
  1066. X */
  1067. X/*    $Header: get_text.c,v 4.1 88/06/21 13:33:49 bianchi Exp $
  1068. X    $Source: /tmp/mgrsrc/src/RCS/get_text.c,v $
  1069. X*/
  1070. Xstatic char    RCSid_[] = "$Source: /tmp/mgrsrc/src/RCS/get_text.c,v $$Revision: 4.1 $";
  1071. X
  1072. X/* sweep out text rectangle */
  1073. X
  1074. X#include <stdio.h>
  1075. X#include "bitmap.h"
  1076. X#include "defs.h"
  1077. X#include "font.h"
  1078. X#include "event.h"
  1079. X
  1080. X#define FSIZE(c)    ((int) (W(font)->head.c))
  1081. X#define THICK    2
  1082. X
  1083. X#define TOP    1
  1084. X#define MIDDLE    2
  1085. X#define BOTTOM    3
  1086. X#define ALL    4
  1087. X
  1088. Xint
  1089. Xget_text(screen,mouse,x,y,dx,dy,win,c)
  1090. XBITMAP *screen;        /* where to sweep out the box */
  1091. Xint mouse;            /* file to get mouse coords from */
  1092. Xint x,y;            /* starting position */
  1093. Xregister int *dx,*dy;        /* box width,height */
  1094. XWINDOW *win;            /* text window */
  1095. Xint c;                /* E_SWTEXT or E_SWTEXTT */
  1096. X   {
  1097. X   register int button;
  1098. X   int left,top;
  1099. X   int cols,rows;
  1100. X   int gx,gy;
  1101. X   int x_mouse, y_mouse;
  1102. X   int lastdx, lastdy;                /* previous dx,dy */
  1103. X    int newx = *dx * FSIZE(wide);
  1104. X    int newy = *dy * FSIZE(high);  
  1105. X   rectangle text;
  1106. X
  1107. X   /* set up text regions */
  1108. X
  1109. X   if (c == E_SWTEXT)                /* no text region */
  1110. X      text.x = text.y = text.wide = text.high = 0;
  1111. X   else if (!in_text(x,y,win)) {
  1112. X      button=move_mouse(screen,mouse,&mousex,&mousey,1);
  1113. X      return(0);
  1114. X      }
  1115. X   else 
  1116. X      text = W(text);
  1117. X
  1118. X   left = W(x0) + SUM_BDR + text.x;    /* edge of window (pixels) */
  1119. X   top = W(y0) + SUM_BDR + text.y;    /* top of window (pixels) */
  1120. X   cols = (text.wide ? text.wide : BIT_WIDE(W(window)))/FSIZE(wide);
  1121. X   rows = (text.wide ? text.high : BIT_HIGH(W(window)))/FSIZE(high);
  1122. X   gx = FSIZE(wide);            /* char width (pixels) */
  1123. X   gy = FSIZE(high);            /* char height (pixels) */
  1124. X
  1125. X   x = (x-left)/gx;
  1126. X   y = (y-top)/gy;
  1127. X
  1128. X   do_box(screen,x,y,dx,dy,top,left,cols,rows,gx,gy);     /* on */
  1129. X   do {
  1130. X      button=mouse_get(mouse,&x_mouse,&y_mouse);
  1131. X      newx += x_mouse<<1;
  1132. X      newy -= y_mouse<<1;
  1133. X      lastdx = *dx, *dx = newx/gx;
  1134. X      lastdy = *dy ,*dy = newy/gy;
  1135. X      if (lastdx != *dx || lastdy != *dy) {
  1136. X         do_box(screen,x,y,&lastdx,&lastdy,top,left,cols,rows,gx,gy);    /* off*/
  1137. X         if (do_box(screen,x,y,dx,   dy,   top,left,cols,rows,gx,gy))    /* on */
  1138. X            newx = gx * *dx,  newy = gy * *dy;
  1139. X         }
  1140. X      }
  1141. X   while (button!=0);
  1142. X
  1143. X   do_box(screen,x,y,dx,dy,top,left,cols,rows,gx,gy);            /* off*/
  1144. X   return(1);
  1145. X   }
  1146. X
  1147. X/* piece boxes */
  1148. X
  1149. Xint
  1150. Xdo_box(screen,x1,y1,px,py,top,left,cols,rows,gx,gy)
  1151. XBITMAP *screen;
  1152. Xint x1,y1;        /* starting pos in rows/cols */
  1153. Xint *px,*py;        /* ending delta in rows/cols */
  1154. Xint top,left;        /* start of window in pixels */
  1155. Xint cols,rows;        /* size of window */
  1156. Xint gx,gy;        /* character size (in pixels) */
  1157. X   {
  1158. X   register int dx = *px;
  1159. X   register int dy = *py;
  1160. X
  1161. X   if (dy < 0)
  1162. X      dy = 0;
  1163. X
  1164. X   if (dy == 0 && dx < 0)
  1165. X      dx = 0;
  1166. X
  1167. X   if (x1 + dx < 0)
  1168. X      dx = -x1;
  1169. X
  1170. X   if (x1+dx > cols)
  1171. X      dx = cols-x1;
  1172. X
  1173. X   if (y1+ dy >= rows)
  1174. X      dy = rows-y1-1;
  1175. X
  1176. X   switch(dy) {
  1177. X      case 0:        /* 1 line */
  1178. X         tbox(screen, left+x1*gx-1, top+y1*gy-2,   dx*gx,       gy+3, ALL);
  1179. X         break;
  1180. X      case 1:        /* two lines */
  1181. X         tbox(screen, left+x1*gx-1, top+y1*gy-2,       (cols-x1)*gx,  gy+2, TOP);
  1182. X         tbox(screen, left-1,       top + (y1+1)*gy, (x1+dx)*gx,    gy+1, BOTTOM);
  1183. X         break;
  1184. X      default:        /* many lines */
  1185. X         tbox(screen, left+x1*gx-1, top + y1*gy-2,      (cols-x1)*gx, gy+2, TOP);
  1186. X         tbox(screen, left-1,       top + (y1+1)*gy,  cols*gx,      (dy-1)*gy, MIDDLE);
  1187. X         tbox(screen, left-1,       top + (y1+dy)*gy, (x1+dx)*gx,   gy+1, BOTTOM);
  1188. X         break;
  1189. X      }
  1190. X   if (*px != dx || *py != dy) {
  1191. X      *px = dx; *py = dy;
  1192. X      return(1);
  1193. X      }
  1194. X   else
  1195. X      return(0);
  1196. X   }
  1197. X
  1198. X/* draw a box */
  1199. X
  1200. X#define INVERT(screen,x,y,wide,high) \
  1201. X    bit_blit(screen,x,y,wide,high,BIT_NOT(BIT_DST),NULL_DATA,0,0);
  1202. X
  1203. Xstatic
  1204. Xtbox(screen,x1,y1,dx,dy,side)
  1205. XBITMAP *screen;
  1206. Xint x1,y1,dx,dy;
  1207. Xint side;
  1208. X   {
  1209. X   switch (side) {
  1210. X      case TOP:
  1211. X         INVERT(screen,x1,y1,dx,THICK);
  1212. X         INVERT(screen,x1+dx,y1,THICK, dy);
  1213. X         INVERT(screen,x1+THICK,y1+dy,dx-THICK,THICK);
  1214. X         INVERT(screen,x1,y1+THICK,THICK, dy-THICK);
  1215. X         break;
  1216. X      case MIDDLE:
  1217. X         INVERT(screen,x1+THICK,y1,dx-THICK,THICK);
  1218. X         INVERT(screen,x1+dx,y1+THICK,THICK, dy-THICK);
  1219. X         INVERT(screen,x1+THICK,y1+dy,dx-THICK,THICK);
  1220. X         INVERT(screen,x1,y1+THICK,THICK, dy-THICK);
  1221. X         break;
  1222. X      case BOTTOM:
  1223. X         INVERT(screen,x1+THICK,y1,dx-THICK,THICK);
  1224. X         INVERT(screen,x1+dx,y1+THICK,THICK, dy-THICK);
  1225. X         INVERT(screen,x1+THICK,y1+dy,dx,THICK);
  1226. X         INVERT(screen,x1,y1+THICK,THICK, dy);
  1227. X         break;
  1228. X      case ALL:
  1229. X         INVERT(screen,x1,y1,dx,THICK);
  1230. X         INVERT(screen,x1+dx,y1,THICK, dy);
  1231. X         INVERT(screen,x1+THICK,y1+dy,dx,THICK);
  1232. X         INVERT(screen,x1,y1+THICK,THICK, dy);
  1233. X         break;
  1234. X      }
  1235. X   }
  1236. END_OF_FILE
  1237. # end of 'src/get_text.c'
  1238. fi
  1239. if test -f 'src/getshell.c' -a "${1}" != "-c" ; then 
  1240.   echo shar: Will not clobber existing file \"'src/getshell.c'\"
  1241. else
  1242. echo shar: Extracting \"'src/getshell.c'\" \(5305 characters\)
  1243. sed "s/^X//" >'src/getshell.c' <<'END_OF_FILE'
  1244. X/*                        Copyright (c) 1987 Bellcore
  1245. X *                            All Rights Reserved
  1246. X *       Permission is granted to copy or use this program, EXCEPT that it
  1247. X *       may not be sold for profit, the copyright notice must be reproduced
  1248. X *       on copies, and credit should be given to Bellcore where it is due.
  1249. X *       BELLCORE MAKES NO WARRANTY AND ACCEPTS NO LIABILITY FOR THIS PROGRAM.
  1250. X */
  1251. X/*    $Header: getshell.c,v 4.1 88/06/21 13:33:51 bianchi Exp $
  1252. X    $Source: /tmp/mgrsrc/src/RCS/getshell.c,v $
  1253. X*/
  1254. Xstatic char    RCSid_[] = "$Source: /tmp/mgrsrc/src/RCS/getshell.c,v $$Revision: 4.1 $";
  1255. X
  1256. X/* start a shell */
  1257. X
  1258. X#include <sys/file.h>
  1259. X#include <sys/signal.h>
  1260. X#include <sgtty.h>
  1261. X#include <stdio.h>
  1262. X#include "bitmap.h"
  1263. X#include "defs.h"
  1264. X
  1265. X#define SHELL        "/bin/sh"
  1266. X
  1267. Xstatic char line[] = {"/dev/ptypX"};
  1268. Xstatic int  pty_index=5;        /* better hit rate than 0 */
  1269. Xextern char **environ;
  1270. X
  1271. X/*    get a pty line */
  1272. X
  1273. Xint
  1274. Xgetapty()
  1275. X   {
  1276. X   register int i;
  1277. X   int fd;
  1278. X
  1279. X   line[5] = 'p';
  1280. X   for(line[8]='p';line[8]<'r';line[8]+= 1)
  1281. X      for (i=1;i<=16;i++) {
  1282. X         line[9]="0123456789abcdef"[(pty_index+i)%16];
  1283. X         if ((fd = open(line,2)) >= 0) {
  1284. X            /* pty_index = (pty_index+i)%16;   temp */
  1285. X            line[5] = 't';
  1286. X            return(fd);
  1287. X            }
  1288. X         }
  1289. X   return(-1);
  1290. X   }
  1291. X      
  1292. Xint getatty()
  1293. X   {
  1294. X   int fd;
  1295. X   line[5]='t';
  1296. X   fd=open(line,2);
  1297. X   if (fd<0) {
  1298. X      sleep(3);
  1299. X      return (open(line,2));
  1300. X      }
  1301. X   return(fd);
  1302. X   }
  1303. X
  1304. Xchar *
  1305. Xlast_tty()
  1306. X   {
  1307. X   return(line);
  1308. X   }
  1309. X
  1310. X/******************************************************************************/
  1311. X/* start a command */
  1312. X
  1313. Xget_command(argv,file)
  1314. Xchar **argv;
  1315. Xint *file;
  1316. X   {
  1317. X   register int i;                /* counter */
  1318. X   int fd;                    /* file desc */
  1319. X   int tty;                    /* fd of /dev/tty */
  1320. X   int pid;                    /* pid of shell */
  1321. X   int group;                    /* process group id */
  1322. X   int tty_slots;                /* # of tty slots */
  1323. X   char *name, *get_path();
  1324. X   char *getenv();
  1325. X   char *shell = getenv("SHELL");
  1326. X   char *arg[2];
  1327. X   char who[MAXNAME];
  1328. X
  1329. X   if (argv == (char **) 0 ) {
  1330. X      argv = arg;
  1331. X      *argv = shell?shell:SHELL;
  1332. X      *(argv+1) = (char *) 0;
  1333. X      }
  1334. X   name = get_path(argv[0]);
  1335. X
  1336. X   if (name == (char *) 0 || *name == '\0')
  1337. X      return(-2);
  1338. X
  1339. X#ifdef DEBUG
  1340. X   dprintf(s)(stderr,"EXECING: ");
  1341. X   for(i=0;argv[i]!='\0';i++)
  1342. X      dprintf(s)(stderr,"%s ",argv[i]);
  1343. X   dprintf(s)(stderr,"\n");
  1344. X#endif
  1345. X
  1346. X   if ((*file=getapty()) < 0)
  1347. X      return(-1);
  1348. X
  1349. X   if ((pid=fork()) > 0) {
  1350. X      /* parent side of fork */
  1351. X      char buff[2];
  1352. X      read(*file,buff,sizeof(buff));    /* wait for slave side to open */
  1353. X#ifdef DEBUG
  1354. X      dprintf(s)(stderr,"EXEC done, slave side open\r\n ");
  1355. X#endif
  1356. X      return(pid);
  1357. X      }
  1358. X   else if (pid<0)
  1359. X      /* error side of fork */
  1360. X      return(pid);
  1361. X
  1362. X   /* child side of fork */
  1363. X   for(i=0;i<NSIG;i++)
  1364. X      signal( i, SIG_DFL );
  1365. X
  1366. X   /* void association with controlling terminal */
  1367. X
  1368. X#ifdef TIOCNOTTY
  1369. X   tty = open("/dev/tty",0);
  1370. X   ioctl(tty,TIOCNOTTY,0);
  1371. X   close(tty);
  1372. X#endif
  1373. X
  1374. X   /* open slave side of ptty */
  1375. X
  1376. X   if ((fd=getatty())<0) {
  1377. X      _quit("");
  1378. X      perror("Slave side of p-tty won't open");
  1379. X      exit(1);
  1380. X      }
  1381. X
  1382. X   group=getpid();
  1383. X
  1384. X#ifndef SYSV
  1385. X   tty_slots = getdtablesize();
  1386. X#else
  1387. X   tty_slots = 20;
  1388. X#endif
  1389. X
  1390. X   for(i=0;i<tty_slots;i++) if (i != fd) close(i);
  1391. X
  1392. X   /* set the uid-0 stuff up */
  1393. X
  1394. X   if (geteuid() < 1) {
  1395. X      int uid = getuid();
  1396. X      fchmod(fd,0622);
  1397. X      fchown(fd,uid,-1);
  1398. X      setreuid(uid,uid);
  1399. X
  1400. X      uid = getgid();
  1401. X      fchown(fd,-1,uid);
  1402. X      setregid(uid,uid);
  1403. X      }
  1404. X
  1405. X   i = dup(fd);
  1406. X   close(fd);
  1407. X   dup(i);
  1408. X   dup(i);
  1409. X
  1410. X   setpgrp(group,group);
  1411. X   ioctl(0,TIOCSPGRP,&group);
  1412. X
  1413. X    adjust_mode(NTTYDISC,ECHO|CRMOD|EVENP|ODDP);
  1414. X    restore_modes(0);
  1415. X
  1416. X   /* add a utmp entry */
  1417. X
  1418. X#ifdef WHO
  1419. X   add_utmp(0,sprintf(who,"%s%c",HOST,line[9]));
  1420. X#endif
  1421. X
  1422. X   /* start the command */
  1423. X
  1424. X#ifdef DEBUG
  1425. X   dprintf(s)(stderr,"execing %s (%s ...)\r\n",name,*argv);
  1426. X#endif
  1427. X
  1428. X   do_env("TERM=",TERMNAME);
  1429. X   do_env("TERMCAP=","");
  1430. X
  1431. X   write(2,"\n",1);    /* tell master that slave side is open */
  1432. X   execve(name,argv,environ);
  1433. X   _exit(1);
  1434. X   }
  1435. X
  1436. X/* half open a ptty then return */
  1437. X
  1438. Xchar *
  1439. Xhalf_open(file)
  1440. Xint *file;
  1441. X   {
  1442. X   register int i;                /* counter */
  1443. X   int pid;                    /* file desc */
  1444. X
  1445. X   if ((*file=getapty()) < 0)
  1446. X      return((char *) 0);
  1447. X   ioctl(*file,TIOCREMOTE,0);    /* I dunno */
  1448. X   return(line);
  1449. X   }
  1450. X
  1451. X/* get a complete path name from command */
  1452. X
  1453. Xstatic char path[512];
  1454. Xstatic char start[512];
  1455. X
  1456. Xchar *
  1457. Xget_path(name)
  1458. Xchar *name;
  1459. X   {
  1460. X   char *getenv(), *index();
  1461. X   register char c, *next, *list;
  1462. X
  1463. X   if (index("/.",*name))
  1464. X      if (access(name,X_OK)==0)
  1465. X         return(name);
  1466. X      else
  1467. X         return((char *)0);
  1468. X
  1469. X   strcpy(start,getenv("PATH"));
  1470. X   for(list=start;next=index(list,':');list=next+1) {
  1471. X      *next = '\0';
  1472. X      sprintf(path,"%s/%s",list,name);
  1473. X      if (access(path,X_OK) == 0)
  1474. X         return(path);
  1475. X      }
  1476. X
  1477. X   sprintf(path,"%s/%s",list,name);
  1478. X   if (list && access(path,X_OK) == 0) {
  1479. X      return(path);
  1480. X      }
  1481. X   else {
  1482. X      return((char *) 0);
  1483. X      }
  1484. X   }
  1485. X
  1486. X/* change an environment variable */
  1487. X
  1488. Xdo_env(name,value)
  1489. Xchar *name, *value;
  1490. X   {
  1491. X   register int i;
  1492. X   int n = strlen(name);
  1493. X   
  1494. X   for(i=0;environ[i] != (char *) 0;i++)
  1495. X      if (strncmp(environ[i],name,n) == 0) {
  1496. X         strcpy(environ[i]+n,value);
  1497. X         break;
  1498. X         }
  1499. X   }
  1500. END_OF_FILE
  1501. # end of 'src/getshell.c'
  1502. fi
  1503. if test -f 'src/oblit/line.c' -a "${1}" != "-c" ; then 
  1504.   echo shar: Will not clobber existing file \"'src/oblit/line.c'\"
  1505. else
  1506. echo shar: Extracting \"'src/oblit/line.c'\" \(5272 characters\)
  1507. sed "s/^X//" >'src/oblit/line.c' <<'END_OF_FILE'
  1508. X/*                        Copyright (c) 1988 Bellcore
  1509. X *                            All Rights Reserved
  1510. X *       Permission is granted to copy or use this program, EXCEPT that it
  1511. X *       may not be sold for profit, the copyright notice must be reproduced
  1512. X *       on copies, and credit should be given to Bellcore where it is due.
  1513. X *       BELLCORE MAKES NO WARRANTY AND ACCEPTS NO LIABILITY FOR THIS PROGRAM.
  1514. X */
  1515. X/*    $Header: line.c,v 4.2 88/07/07 10:57:06 sau Exp $
  1516. X    $Source: /tmp/mgrsrc/src/oblit/RCS/line.c,v $
  1517. X*/
  1518. Xstatic char    RCSid_[] = "$Source: /tmp/mgrsrc/src/oblit/RCS/line.c,v $$Revision: 4.2 $";
  1519. X
  1520. X/*  Draw a line 16 bit version */
  1521. X
  1522. X#include "bitmap.h"
  1523. X
  1524. Xbit_line(dest, x0, y0, x1, y1, func)
  1525. XBITMAP *dest;
  1526. Xint x0, y0, x1, y1;
  1527. Xint func;
  1528. X{
  1529. X   register int r, rincr, rdecr, d_incr, count;
  1530. X   register unsigned short bit;
  1531. X   register unsigned short *dst;
  1532. X   int temp, dx, dy;
  1533. X
  1534. X   /* clip here */
  1535. X
  1536. X#define TOP        1
  1537. X#define BOTTOM    2
  1538. X#define LEFT    4
  1539. X#define RIGHT    8
  1540. X
  1541. X#define crossings(x,y) \
  1542. X      (x<0 ? LEFT : x>= (b->wide) ? RIGHT : 0) + \
  1543. X      (y < 0 ? TOP : y >=  (b -> high) ? BOTTOM : 0)
  1544. X
  1545. X   {
  1546. X      register BITMAP *b = dest;
  1547. X
  1548. X      /* The classic clipping algorithm */
  1549. X
  1550. X      int Cross0 = crossings(x0, y0);
  1551. X      int Cross1 = crossings(x1, y1);
  1552. X
  1553. X      while (Cross0 || Cross1) {
  1554. X     int Cross, x, y;
  1555. X     if (Cross0 & Cross1)
  1556. X        return;
  1557. X     if (Cross0 != 0)
  1558. X        Cross = Cross0;
  1559. X     else
  1560. X        Cross = Cross1;
  1561. X     if (Cross & (LEFT | RIGHT)) {
  1562. X        int edge = (Cross & LEFT) ? 0 : b->wide - 1;
  1563. X        y = y0 + (y1 - y0) * (edge - x0) / (x1 - x0);
  1564. X        x = edge;
  1565. X     }
  1566. X     else if (Cross & (TOP | BOTTOM)) {
  1567. X        int edge = (Cross & TOP) ? 0 : b->high - 1;
  1568. X        x = x0 + (x1 - x0) * (edge - y0) / (y1 - y0);
  1569. X        y = edge;
  1570. X     }
  1571. X     if (Cross == Cross0) {
  1572. X        x0 = x;
  1573. X        y0 = y;
  1574. X        Cross0 = crossings(x, y);
  1575. X     }
  1576. X     else {
  1577. X        x1 = x;
  1578. X        y1 = y;
  1579. X        Cross1 = crossings(x, y);
  1580. X     }
  1581. X      }
  1582. X      x0 += b->x0;
  1583. X      y0 += b->y0;
  1584. X      x1 += b->x0;
  1585. X      y1 += b->y0;
  1586. X   }
  1587. X
  1588. X   /* always left to right */
  1589. X
  1590. X   if (x1 < x0) {
  1591. X      temp = x1, x1 = x0, x0 = temp;
  1592. X      temp = y1, y1 = y0, y0 = temp;
  1593. X   }
  1594. X   dx = x1 - x0;
  1595. X   dy = y1 - y0;
  1596. X   if (dy > 0)
  1597. X      d_incr = BIT_LINE(dest);
  1598. X   else
  1599. X      d_incr = -(BIT_LINE(dest)), dy = -dy;
  1600. X
  1601. X   dst = (x0 >> 4) + y0 * (BIT_LINE(dest)) + (dest->data);    /*-*/
  1602. X   bit = (0x8000 >> (x0 & 15));
  1603. X
  1604. X   /* */
  1605. X
  1606. X   if (dx > dy)
  1607. X      switch (OPCODE(func)) {
  1608. X     case OPCODE(SRC):
  1609. X     case OPCODE(SRC | DST):
  1610. X     case OPCODE(SRC | ~DST):
  1611. X     case OPCODE(~0):
  1612. X        {
  1613. X           rincr = (dx - dy) << 1;
  1614. X           rdecr = -(dy << 1);
  1615. X           r = dx + rdecr;
  1616. X           for (count = dx; count >= 0; count--) {
  1617. X          *dst |= bit;
  1618. X          if ((bit >>= 1) == 0) {
  1619. X             bit = 0x8000;
  1620. X             dst++;
  1621. X          }
  1622. X
  1623. X          ;
  1624. X          if (r < 0) {
  1625. X             dst += d_incr;
  1626. X             r += rincr;
  1627. X          }
  1628. X
  1629. X          else {
  1630. X             r += rdecr;
  1631. X          }
  1632. X
  1633. X           }
  1634. X
  1635. X        }
  1636. X
  1637. X        ;
  1638. X        break;
  1639. X    case OPCODE(~SRC):
  1640. X    case OPCODE(~(SRC|DST)):
  1641. X    case OPCODE(DST & ~SRC):
  1642. X    case OPCODE(0):
  1643. X        {
  1644. X           rincr = (dx - dy) << 1;
  1645. X           rdecr = -(dy << 1);
  1646. X           r = dx + rdecr;
  1647. X           for (count = dx; count >= 0; count--) {
  1648. X          *dst &= ~bit;
  1649. X          if ((bit >>= 1) == 0) {
  1650. X             bit = 0x8000;
  1651. X             dst++;
  1652. X          }
  1653. X
  1654. X          ;
  1655. X          if (r < 0) {
  1656. X             dst += d_incr;
  1657. X             r += rincr;
  1658. X          }
  1659. X
  1660. X          else {
  1661. X             r += rdecr;
  1662. X          }
  1663. X
  1664. X           }
  1665. X
  1666. X        }
  1667. X
  1668. X        ;
  1669. X        break;
  1670. X    case OPCODE(SRC ^ DST):
  1671. X    case OPCODE(~DST):
  1672. X    case OPCODE(SRC & ~DST):
  1673. X    case OPCODE(~(SRC&DST)):
  1674. X        {
  1675. X           rincr = (dx - dy) << 1;
  1676. X           rdecr = -(dy << 1);
  1677. X           r = dx + rdecr;
  1678. X           for (count = dx; count >= 0; count--) {
  1679. X          *dst ^= bit;
  1680. X          if ((bit >>= 1) == 0) {
  1681. X             bit = 0x8000;
  1682. X             dst++;
  1683. X          }
  1684. X
  1685. X          ;
  1686. X          if (r < 0) {
  1687. X             dst += d_incr;
  1688. X             r += rincr;
  1689. X          }
  1690. X
  1691. X          else {
  1692. X             r += rdecr;
  1693. X          }
  1694. X
  1695. X           }
  1696. X
  1697. X        }
  1698. X
  1699. X        ;
  1700. X        break;
  1701. X      }
  1702. X
  1703. X   else
  1704. X      switch (OPCODE(func)) {
  1705. X    case OPCODE(SRC):
  1706. X    case OPCODE(SRC | DST):
  1707. X    case OPCODE(SRC | ~DST):
  1708. X    case OPCODE(~0):
  1709. X        {
  1710. X           rincr = (dy - dx) << 1;
  1711. X           rdecr = -(dx << 1);
  1712. X           r = dy + rdecr;
  1713. X           for (count = dy; count >= 0; count--) {
  1714. X          *dst |= bit;
  1715. X          dst += d_incr;
  1716. X          if (r < 0) {
  1717. X             if ((bit >>= 1) == 0) {
  1718. X            bit = 0x8000;
  1719. X            dst++;
  1720. X             }
  1721. X
  1722. X             ;
  1723. X             r += rincr;
  1724. X          }
  1725. X
  1726. X          else {
  1727. X             r += rdecr;
  1728. X          }
  1729. X
  1730. X           }
  1731. X
  1732. X        }
  1733. X
  1734. X        ;
  1735. X        break;
  1736. X    case OPCODE(~SRC):
  1737. X    case OPCODE(~(SRC|DST)):
  1738. X    case OPCODE(DST & ~SRC):
  1739. X    case OPCODE(0):
  1740. X        {
  1741. X           rincr = (dy - dx) << 1;
  1742. X           rdecr = -(dx << 1);
  1743. X           r = dy + rdecr;
  1744. X           for (count = dy; count >= 0; count--) {
  1745. X          *dst &= ~bit;
  1746. X          dst += d_incr;
  1747. X          if (r < 0) {
  1748. X             if ((bit >>= 1) == 0) {
  1749. X            bit = 0x8000;
  1750. X            dst++;
  1751. X             }
  1752. X
  1753. X             ;
  1754. X             r += rincr;
  1755. X          }
  1756. X
  1757. X          else {
  1758. X             r += rdecr;
  1759. X          }
  1760. X
  1761. X           }
  1762. X
  1763. X        }
  1764. X
  1765. X        ;
  1766. X        break;
  1767. X    case OPCODE(SRC ^ DST):
  1768. X    case OPCODE(~DST):
  1769. X    case OPCODE(SRC & ~DST):
  1770. X    case OPCODE(~(SRC&DST)):
  1771. X        {
  1772. X           rincr = (dy - dx) << 1;
  1773. X           rdecr = -(dx << 1);
  1774. X           r = dy + rdecr;
  1775. X           for (count = dy; count >= 0; count--) {
  1776. X          *dst ^= bit;
  1777. X          dst += d_incr;
  1778. X          if (r < 0) {
  1779. X             if ((bit >>= 1) == 0) {
  1780. X            bit = 0x8000;
  1781. X            dst++;
  1782. X             }
  1783. X
  1784. X             ;
  1785. X             r += rincr;
  1786. X          }
  1787. X
  1788. X          else {
  1789. X             r += rdecr;
  1790. X          }
  1791. X
  1792. X           }
  1793. X
  1794. X        }
  1795. X
  1796. X        ;
  1797. X        break;
  1798. X      }
  1799. X
  1800. X}
  1801. END_OF_FILE
  1802. # end of 'src/oblit/line.c'
  1803. fi
  1804. echo shar: End of archive 21 \(of 61\).
  1805. cp /dev/null ark21isdone
  1806. MISSING=""
  1807. for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 \
  1808.     21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 \
  1809.     38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 \
  1810.     55 56 57 58 59 60 61 ; do
  1811.     if test ! -f ark${I}isdone ; then
  1812.     MISSING="${MISSING} ${I}"
  1813.     fi
  1814. done
  1815. if test "${MISSING}" = "" ; then
  1816.     echo You have unpacked all 61 archives.
  1817.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1818. else
  1819.     echo You still need to unpack the following archives:
  1820.     echo "        " ${MISSING}
  1821. fi
  1822. ##  End of shell archive.
  1823. exit 0
  1824.